package com.yitong.equipment.entity.res

import android.os.Parcel
import android.os.Parcelable

class HomeData() : Parcelable{
    var name : String? = null
    var cover : String? = null
    var price : String? = null
    var originalPrice : String? = null
    var startDateContent : String? = null
    var startDate : String? = null
    var type : String? = null
    var subjects : String? = null
    var klassTime : String? = null

    constructor(parcel: Parcel) : this() {
        name = parcel.readString()
        cover = parcel.readString()
        price = parcel.readString()
        originalPrice = parcel.readString()
        startDateContent = parcel.readString()
        startDate = parcel.readString()
        type = parcel.readString()
        subjects = parcel.readString()
        klassTime = parcel.readString()
    }

    override fun toString(): String {
        return "HomeData(name=$name, cover=$cover, price=$price, originalPrice=$originalPrice, startDateContent=$startDateContent, startDate=$startDate, type=$type, subjects=$subjects, klassTime=$klassTime)"
    }

    override fun writeToParcel(parcel: Parcel, flags: Int) {
        parcel.writeString(name)
        parcel.writeString(cover)
        parcel.writeString(price)
        parcel.writeString(originalPrice)
        parcel.writeString(startDateContent)
        parcel.writeString(startDate)
        parcel.writeString(type)
        parcel.writeString(subjects)
        parcel.writeString(klassTime)
    }

    override fun describeContents(): Int {
        return 0
    }

    companion object CREATOR : Parcelable.Creator<HomeData> {
        override fun createFromParcel(parcel: Parcel): HomeData {
            return HomeData(parcel)
        }

        override fun newArray(size: Int): Array<HomeData?> {
            return arrayOfNulls(size)
        }
    }

}